package com.hctg.forced2sleep.bean;

import com.actor.myandroidframework.application.ActorApplication;
import com.actor.myandroidframework.utils.easyhttp.EasyHttpConfigUtils;
import com.actor.myandroidframework.utils.okhttputils.OkHttpConfigUtils;
import com.hctg.forced2sleep.utils.BuglyUtils;
import com.hjq.http.EasyConfig;

import okhttp3.OkHttpClient;

/**
 * description: 强制早睡
 * company    :
 * @author    : ldf
 * date       : 2019/4/27 on 15:02
 */
public class MyApplication extends ActorApplication {

    @Override
    public void onCreate() {
        super.onCreate();
        OkHttpClient.Builder builder = EasyHttpConfigUtils.initOkHttp(isAppDebug());
        OkHttpClient okHttpClient = OkHttpConfigUtils.addLogInterceptor(builder, isAppDebug());
        EasyHttpConfigUtils.init(false, Global.BASE_URL, okHttpClient);
        EasyConfig.getInstance().addHeader("packageName", "com.yunlian.meditationmode");
        EasyConfig.getInstance().addHeader("ylxc", "1");
        EasyConfig.getInstance().addHeader("startCount", "0");
        EasyConfig.getInstance().addHeader("u", "sdfsdfsdfsdf");

        BuglyUtils.init(Global.BUGLY_ID);
    }

    @Override
    protected void onUncaughtException(Throwable e) {
        super.onUncaughtException(e);
    }
}
